#!/bin/bash
# 上传项目到Gitee的脚本

echo "=== ESP32-RK3588 项目上传到Gitee ==="

echo "📋 上传步骤："
echo ""
echo "1️⃣ 首先在Gitee上创建仓库："
echo "   - 访问: https://gitee.com/new"
echo "   - 仓库名称: esp32-arduino-python"
echo "   - 描述: ESP32-RK3588 Arduino风格传感器控制系统"
echo "   - 选择: 公开仓库"
echo "   - 不要初始化README (我们已经有了)"
echo ""

echo "2️⃣ 创建完成后，运行以下命令："
echo ""
echo "# 添加远程仓库"
echo "git remote add origin https://gitee.com/haitaowang926/esp32-arduino-python.git"
echo ""
echo "# 推送代码"
echo "git push -u origin main"
echo ""

echo "3️⃣ 如果需要强制推送 (仓库已存在但为空)："
echo "git push -u origin main --force"
echo ""

echo "4️⃣ 验证上传："
echo "访问: https://gitee.com/haitaowang926/esp32-arduino-python"
echo ""

echo "📊 项目信息："
echo "- 项目名称: ESP32-RK3588 Arduino风格传感器控制系统"
echo "- 作者: 王海涛 (haitaowang926@gmail.com)"
echo "- 许可证: MIT"
echo "- 主要特性: Arduino风格Python API, 扩展板支持, 丰富示例"
echo ""

echo "🏷️ 建议的仓库标签："
echo "esp32, arduino, python, iot, embedded, hardware, sensor, rk3588"
echo ""

echo "📝 仓库描述建议："
echo "一个基于ESP32和RK3588的传感器控制系统，提供Arduino风格的Python API。"
echo "支持数字IO、模拟输入、传感器读取等功能，包含完整的示例和文档。"
echo ""

# 检查Git状态
echo "🔍 当前Git状态："
git status --porcelain
if [ $? -eq 0 ]; then
    echo "✅ Git仓库状态正常"
else
    echo "❌ Git仓库状态异常"
fi

echo ""
echo "📁 准备上传的文件："
git ls-files | head -20
total_files=$(git ls-files | wc -l)
echo "... (共 $total_files 个文件)"

echo ""
echo "🚀 准备就绪！请按照上述步骤在Gitee上创建仓库并推送代码。"